Skip to content

bch(g2-c3): donation P2PK<->P2SH byte-correctness KAT - #876

Merged
frstrtr merged 1 commit into
masterfrom
bch/g2-donation-flip-kat
Jul 26, 2026
Merged

bch(g2-c3): donation P2PK<->P2SH byte-correctness KAT#876
frstrtr merged 1 commit into
masterfrom
bch/g2-donation-flip-kat

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 26, 2026

Copy link
Copy Markdown
Owner

G2-ratchet C3 (C3-FIRST per integrator GO 07-26). Guards the only G2-ratchet failure mode that is silent AND reward-losing: a wrong donation script across the P2PK<->P2SH flip pays the wrong destination with no gate error.

What it pins (byte-KAT over core::donation SSOT, independent hard-coded legs):

  • v<36 leg = 67-byte BCH current-mainnet forrestv P2PK (NOT a copied LTC/DASH vector; pubkey-prefix identity check guards a silent swap)
  • v>=36 leg = 23-byte combined 1-of-2 P2SH
  • flip boundary EXACTLY at version 36 (no off-by-one -> byte-offset-104 GENTX divergence class)
  • GENTX=0 posture: exactly one donation script per version; author + verify both delegate to the SSOT

Discipline: KAT-only, no gate-logic change, header-only over <core/donation.hpp>. bitcoin_family/ and src/core/*.hpp untouched. Wired into BCH_ABLA_TESTS + both build.yml COIN_BCH target lists. Local ctest #266 PASS. GPG-signed 285EFE76. No self-merge — integrator merges on push approval.

…->v36 flip

Pins the donation script SSOT (core::donation::get_donation_script) byte-for-byte
on both legs: v<36 = 67-byte BCH current-mainnet forrestv P2PK (guarded against a
silent LTC/DASH-copied vector via the pubkey-prefix identity check), v>=36 =
23-byte combined 1-of-2 P2SH. Boundary pinned EXACTLY at version 36 (no off-by-one
byte-offset-104 GENTX divergence). Guards the only G2-ratchet failure mode that is
silent and reward-losing. Header-only, rig-free, gate-logic untouched.

Wired into BCH_ABLA_TESTS and both build.yml COIN_BCH target lists; local ctest
#266 PASS.
@frstrtr
frstrtr merged commit 9638e69 into master Jul 26, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant